class index{
    constructor(){
        this.login = document.querySelector('.login')
        this.regist = document.querySelector('.regist')
        this.library = document.querySelector('.library')
        this.shop = document.querySelector('.shop')
        this.background = document.querySelector('.background')
        this.indexList = document.querySelectorAll('.indexList')
        this.info()
    }


    info(){
        this.clickdisplay()
        this.loginlocalHref()
        this.registlocalHref()
    }

    clickdisplay(){
        this.indexList.forEach(item=>{
            item.addEventListener("click",()=>{
                this.background.style.opacity = "1"
            })
            item.addEventListener("mouseleave",()=>{
                this.background.style.opacity = "0"
            })
        })
    }


    loginlocalHref(){
            this.login.addEventListener("click",()=>{
                setTimeout(()=>{
                    location.href = `html/login.html`
                },1500)
            })
    }
    registlocalHref(){
        this.regist.addEventListener("click",()=>{
            setTimeout(()=>{
                location.href = `html/regist.html`
            },1500)
        })
}
}
const index1 = new index()
